package com.jy.bo.common.conf.enums;

/**
 * @program: binary-option
 * @description
 * @author: frank
 * @create: 2020-08-21 12:09
 **/
public enum BonusStatusEnum {

    PROCESSING(0, "Processing"), COMPLETED(1, "Completed");


    BonusStatusEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    private Integer code;
    private String name;

    public Integer getCode() {
        return code;
    }

    public BonusStatusEnum setCode(Integer code) {
        this.code = code;
        return this;
    }

    public String getName() {
        return name;
    }

    public BonusStatusEnum setName(String name) {
        this.name = name;
        return this;
    }

    public static BonusStatusEnum getEnumByCode(Integer code){
        for(BonusStatusEnum param : BonusStatusEnum.values()){
            if(code == param.getCode()){
                return param;
            }
        }
        return null;
    }
}
